package strangeattractor.equations;

import strangeattractor.core.DPoint;
import strangeattractor.core.Transformer;

public class Lorenz84 implements Transformer {

	public double A, B, C, D, E;
	
	public Lorenz84(double a, double b, double c, double d, double e) {
		super();
		A = a;
		B = b;
		C = c;
		D = d;
		E = e;
	}
	
	@Override
	public DPoint next(DPoint p) {
		double xNew = p.x + E*(-A*p.x - p.y*p.y - p.z*p.z + A*C);
		double yNew = p.y + E*(-p.y + p.x*p.y - B*p.x*p.z + D);
		double zNew = p.z + E*(-p.z + B*p.x*p.y + p.x*p.z);
		return new DPoint(xNew, yNew, zNew);
	}

}
